package com.realgodo.site.entity.application.present;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;

import com.realgodo.site.entity.application.Application;
import com.realgodo.site.entity.space.Space;

@Entity(name = "PresentRecord")
@Table(name = "present_record")
@Inheritance(strategy = InheritanceType.JOINED)
@PrimaryKeyJoinColumn(name = "id", referencedColumnName = "id")
public class PresentRecord extends Application {

	private static final long serialVersionUID = 5174895696596857460L;

	private Present present;

	/** 赠送礼物的人 */
	private Space sender;

	/** 寄语 */
	private String word;

	@ManyToOne
	@JoinColumn(name = "present_id", referencedColumnName = "id", nullable = false)
	public Present getPresent() {
		return present;
	}

	public void setPresent(Present present) {
		this.present = present;
	}

	@ManyToOne
	@JoinColumn(name = "sender_id", referencedColumnName = "id", nullable = false)
	public Space getSender() {
		return sender;
	}

	public void setSender(Space sender) {
		this.sender = sender;
	}

	@Column(name = "word", length = 200)
	public String getWord() {
		return word;
	}

	public void setWord(String word) {
		this.word = word;
	}

}
